<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<lv-group lvGutter="8px">
    <lv-form [formGroup]="formGroup">
        <lv-form-item>
            <lv-form-control [lvErrorTip]="pathErrorTip">
                <input formControlName="path" lv-input class="form-control-input" />
            </lv-form-control>
        </lv-form-item>
    </lv-form>
    <button (click)="add()" lv-button [disabled]="formGroup.invalid">
        {{ 'common_add_label' | i18n }}
    </button>
    <button lv-button lv-popover [lvPopoverContent]="clearAllTpl" lvPopoverTrigger="click" lvPopoverTheme="light"
        lvPopoverPosition="top" #clearAllPathPopover="lvPopover">
        {{ 'common_clear_all_extra_label' | i18n }}
    </button>
</lv-group>
<lv-tag [(ngModel)]='pathTag' (lvRemove)="removeTag()"></lv-tag>

<ng-template #clearAllTpl>
    <div class="aui-gutter-column-md">{{'protection_clear_path_tip_label' | i18n}}</div>
    <div class="lv-modal-btns mgt-btns">
        <lv-group lvGutter='16px'>
            <button lv-button (click)='cancel()'>
                {{ 'common_cancel_label' | i18n }}
            </button>
            <button lv-button lvType='primary' (click)='clearAll()'>
                {{ 'common_ok_label' | i18n }}
            </button>
        </lv-group>
    </div>
</ng-template>